﻿//技能cd
using System;
using UnityEngine;

public class SkillCD
{
    public float MaxCD;
   
    public float LeftCD { get { return MaxCD - (Time.time - _cdStartTime); } }

    public bool IsInCD { get { return LeftCD > 0; } }

    //进入cd的时间戳
    private float _cdStartTime = float.MinValue;

    public void StartCD()
    {
        ReCD();
    }
    //CD回满，重新开始CD
    public void ReCD()
    {
        _cdStartTime = Time.time;
    }
    public void ClearCD()
    {
        _cdStartTime = float.MinValue;//Time.time - 100000f;
    }
}